package com.amithkoujalgi.framework.rest.core;


import java.io.File;


public class AppConfig
{
	public static final String WEBAPP_RESOURCE_BASE = AppConstants.getInstance().getAppHome() + "static-content";
	public static final String DEFAULT_LOG_DIR = AppConstants.getInstance().getAppHome() + "logs";
}

class AppConstants
{
	private static AppConstants instance;

	private AppConstants ()
	{
	}

	public static AppConstants getInstance()
	{
		if( instance == null )
		{
			instance = new AppConstants();
			init();
		}
		return instance;
	}

	private static String userHome, appName, appHome;

	private static void init()
	{
		appName = "restful-app-builder";
		userHome = System.getProperty( "user.home" );
		appHome = userHome + File.separator + appName + File.separator;
	}

	public String getAppHome()
	{
		return appHome;
	}

	public String getAppName()
	{
		return appName;
	}

	public String getUserHome()
	{
		return userHome;
	}
}